#include<iostream>
using namespace std;
void move(int n, char *a, char *b, char *c)

{
	if(n>0)
	{
		move(n-1, a, c, b);
		cout<<"disk "<< n <<" is moved from "<<a <<" to "<<c<< endl;
		move(n-1,b,a,c);
	}
}

void main()
{
	cout<<"enter the number of disks"<< endl;
	int n;
	cin>> n;
	move(n,"tower a", "tower b", "tower c");
	system("pause");
}
